﻿using KAKA.Domain;
using Morus.Infrastructure;

namespace KAKA.Repository
{
    public interface ISettingRepository : IRepository<Setting>
    {
        Setting GetByName(string name);
    }

    public class SettingRepository : Repository<Setting>, ISettingRepository
    {
        public SettingRepository(Database database)
            : base(database)
        {
        }

        public Setting GetByName(string name)
        {
            return base.Get(Spec<Setting>.Eval(r => r.Name == name));
        }
    }
}
